from sqlalchemy.orm import Mapped, mapped_column, relationship
from sqlalchemy import String, ForeignKey
from views.schoolInfo.model.SchoolInfo import CreateSchoolInfo
from settings.publicvar import Base

class PersonBase(Base):
    __tablename__= 'personbase'

    id:Mapped[int] = mapped_column(primary_key=True)
    name:Mapped[str] = mapped_column(String(15),nullable=False)
    IDcard:Mapped[str]=mapped_column(String(18),nullable=False)
    billing_clerk:Mapped[str]=mapped_column(String(15),nullable=False)
    school_id:Mapped[int] = mapped_column(ForeignKey('schoolinfo.id'))

    schoolinfo:Mapped[CreateSchoolInfo] = relationship(lazy=True)

